package com.komorebi.friends.service;

import com.komorebi.friends.controller.TeamUpdateRequest;
import com.komorebi.friends.model.dto.team.TeamDeleteRequest;
import com.komorebi.friends.model.dto.team.TeamJoinRequest;
import com.komorebi.friends.model.dto.team.TeamQueryRequest;
import com.komorebi.friends.model.dto.team.TeamQuitRequest;
import com.komorebi.friends.model.entity.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.komorebi.friends.model.entity.User;
import com.komorebi.friends.model.vo.TeamUserVO;

import java.util.List;

/**
* @author LX-MF
* @description 针对表【team】的数据库操作Service
* @createDate 2024-10-12 23:16:55
*/
public interface TeamService extends IService<Team> {

    /**
     * 新增团队
     * @param team 团队对象
     * @param loginUser 登录用户
     * @return 新增的团队ID
     */
    Long addTeam(Team team, User loginUser);


    /**
     * 查询团队信息
     * @param teamQueryRequest 查询队伍信息封装
     * @param admin 是否为管理员
     * @return 队伍用户信息
     */
    List<TeamUserVO> listTeam(TeamQueryRequest teamQueryRequest, boolean admin);

    /**
     * 修改队伍信息
     * @param teamUpdateRequest 修改队伍信息封装
     * @param loginUser  登录用户
     * @return 是否修改成功
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

    /**
     * 用户申请加入队伍
     * @param teamJoinRequest 申请加入的信息
     * @param loginUser 当前登录用户
     * @return 是否成功
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest  队伍退出请求
     * @param loginUser  登录的用户
     * @return 是否退出成功
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamDeleteRequest 队伍删除请求
     * @param loginUser  登录的用户
     * @return
     */
    boolean deleteTeam(TeamDeleteRequest teamDeleteRequest, User loginUser);
}
